package com.lantosec.hmrp.modules.supplier.entity;

import java.math.BigDecimal;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.supplier.vo.SupplierContractDetailVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 供应商合同明细 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SupplierContractDetail extends BaseEntity<SupplierContractDetailVO> {

    private static final long serialVersionUID = 1L;
    public SupplierContractDetail(SupplierContractDetailVO vo){
        this.contractDetailId = vo.getContractDetailId();
        this.contractId = vo.getContractId();
        this.detailName = vo.getDetailName();
        this.specifications = vo.getSpecifications();
        this.unit = vo.getUnit();
        this.number = vo.getNumber();
        this.price = vo.getPrice();
        this.amount = vo.getAmount();
    }

    @Override
    public SupplierContractDetailVO convertToVO(){
        return new SupplierContractDetailVO(this);
    }


    /**
     * 合同明细ID
     */
    @TableId(value = "contract_detail_id", type = IdType.AUTO)
    private Integer contractDetailId;

    /**
     * 合同ID
     */
    private String contractId;

    /**
     * 明细名称
     */
    private String detailName;

    /**
     * 规格
     */
    private String specifications;

    /**
     * 单位
     */
    private String unit;

    /**
     * 数量
     */
    private BigDecimal number;

    /**
     * 价格
     */
    private BigDecimal price;

    /**
     * 金额
     */
    private BigDecimal amount;


    public enum ColName {
        contract_detail_id, contract_id, detail_name, specifications, unit, number, price, amount, 
    }
}
